using Godot;
using System;
using System.Reflection.Emit;

namespace EnemyStateNode
{
public partial class Aim : Node,StateNode
{
	public Enemy enemy;

	public Timer timer;

	public override void _Ready()
	{
		enemy = GetNode<Enemy>("/root/Main/Enemy");

		timer = GetNode<Timer>("Timer");
		timer.Timeout+=OnTimeout;
	}

	private void OnTimeout()
	{
		enemy.SwitchTo("DashInAir");
	}

	public void OnEnter()
	{
		enemy.GetNode<AnimatedSprite2D>("AnimaEnemy").Animation="aim";
		enemy.enableGravity = false;
		timer.Start();
	}

	public void OnUpdate(float delta)
	{
		if(enemy.Health<=0)
			enemy.SwitchTo("Dead");
	}

	public void OnExit(){}
}

}
